package com.fahai.web.entity;

import lombok.Data;

import javax.persistence.Id;
import java.sql.Timestamp;
import java.util.Date;

/**
 * @ClassName CallFlownoEntity
 * @Description 用户编号
 * @author null
 * @date 2017-05-19 14:31:11
 * @version 1.0 
 */
@Data
public class CallFlowno {
    @Id
    private Integer id;

    private Integer calledDuration;
    private String uname;
    private String uphone;
    private Long bid;
    private Integer callerDuration;
    private Byte lawyerStatus;
    private Byte userStatus;
    private String laPhone;
    private Integer userid;
    private String usPhone;

    private Integer lawyerid;
    private String lawyername;
    private String lawyerPhone;

    private Timestamp starttime;     //开始时间

    private Timestamp stoptime;      //通话结束时间
    //0:用户 1:律师
    private Integer initiator;
    private Long callId;
    //IDC机房的存储目录+文件名，前置域名从全局表查询
    private String voiceUrl;
    //公司内部的备份目录+文件名，前置域名从全局表查询
    private String voiceBak;
    private String cacheUrl;
    //0:有效1:无效
    private Integer isEffective;
    private Date bakTime;
    private Date upUrlTime;
    private Integer proid;
    private String proName;
    private Integer callStatus;
    //0:未接通 1:接通
    private Integer isConnect;
    //0:未处理 1:处理
    private Integer isDispose;
    private Date createTime;
    private Date updateTime;
    private String bak;
    private String bak1;
    private String bak2;


    public String isGoodCallStr;
    public String getIsGoodCallStr(){
        if(calledDuration>5 && calledDuration<30){
            return "有效通话";
        }else if(calledDuration>30){
            return "优质通话";
        }else{
            return "未知";
        }

    }

    //发起方
    public String initiatorStr;

    //是否有效
    public String isEffectiveStr;

    public String getIsEffectiveStr() {
        switch (this.isEffective) {
            case 1:
                return "有效";
            case 0:
                return "无效";
            default:
                return "未知";
        }

    }

    public String getInitiatorStr() {

        switch (this.initiator) {
            case 1:
                return "律师";
            case 0:
                return "客户";
            default:
                return "未知";
        }
    }

    //通话结果
    public String callStatusStr;


    public Timestamp startTime;

}